<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>库存管理</title>
<script type="text/javascript">
    function downloadExcel() {
        var goods_sku = $("#goods_sku").val();
        var goods_name = $("#goods_name").val();
        location.href = "/stocks/ajaxbutton?op=downloadExcel&goods_sku="+goods_sku+"&goods_name="+goods_name;
    }
    
</script>
<body class="withvernav">
<div class="bodywrapper">
    {{include file='/public/leftmenu.tpl'}}
    <div class="centercontent">
        <div class="pageheader notab">
            <h1 class="pagetitle">库存管理</h1>
            <span class="pagedesc"></span>
            <!--
            <div class="menulist">
                <ul class="profile_summary">
                    {{if $managers || in_array('115',$showpower)}}  <li> <a href="/stocks/addStock" ><span>添加</span></a></li>{{/if}}
                </ul>
            </div>
            -->
        </div>
        <!--pageheader-->
        <div id="contentwrapper" class="contentwrapper">
            <div id="basicform" class="subcontent">
                <!--搜索栏-->
                <div>
                    <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
                </div>
                <form class="stdform stdform2" method="get" id="search" action="/stocks/stockList">
                    <div class="tableoptions">
                        商品编号:
                        <input type="text" name="goods_sku" id="goods_sku" class="width200" value="{{$goods_sku}}" placeholder="请输入商品编号" style="width:120px;"/>
                        商品名称:
                        <input type="text" name="goods_name" id="goods_name" class="width200" value="{{$goods_name}}" placeholder="请输入商品名称" style="width:120px;"/>
                       <!--暂时隐藏该功能
                        是否警戒库存：
                        <input type="checkbox" name="alert_stock" id="alert_stock" class="width200" />-->
                        &nbsp;
                        <button class="btn btn_orange btn_search radius50">查询</button>
                        <!--
                        <a href="javascript:void();" onClick="searchRecord()">
                            <button class="btn btn_orange btn_search radius50">盘点记录</button>
                        </a>-->
                        <a href="javascript:void();" onClick="downloadExcel()">
                            <button type="button" class="btn btn_orange btn_search radius50">下载excel</button>
                        </a>
                    </div>
                </form>
                <!--搜索栏结束-->
                <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
                    <thead>
                    <tr class="lbbt">
                        <td  bgcolor="#FEFFF1">商品编号</td>
                        <td  bgcolor="#FEFFF1">商品名称</td>
                        <td  bgcolor="#FEFFF1">库存数量</td>
                        <td  bgcolor="#FEFFF1">操作</td>
                    </tr>
                    </thead>
                    <tbody >
                    {{foreach from=$stocklist item=li key=key}}
                    <tr>
                        <td valign="middle" bgcolor="#FFFFFF">
                            <a href="/product/productlist?other={{{{$li.productsku}}}}">{{$li.productsku}}</a>
                        </td>
                        <td bgcolor="#FFFFFF">
                            {{$li.productname}}
                        </td>
                        <td  bgcolor="#FEFFF1">{{$li.savenum}}</td>
                        <td bgcolor="#FFFFFF">
                            <a href="/stocks/ajaxbutton?op=doShowStockDetails&productsku={{$li.productsku}}" style="color:dodgerblue;">明细</a>
                        </td>
                    </tr>
                    {{/foreach}}
                    </tbody>
                </table>
                <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
            </div>
        </div>
</body>
</html>